package g.beny.manage.action;

import g.beny.framework.log.annotation.DbLog;
import g.beny.framework.validation.Errors;
import g.beny.framework.web.ActionSupport;
import g.beny.manage.bean.Appmenu;
import g.beny.manage.services.AppmenuService;

import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Param;

@At("/Appmenu")
@IocBean
public class AppmenuAction extends ActionSupport{
	@Inject
    private AppmenuService  appmenuService;
	
	@At
	@Aop("dblog")
	public Object list(@Param("page") int page ,@Param("rows") int rows){
		return appmenuService.list(page,rows);
	}
	
	@At
	@DbLog("添加菜单了....")  
	@Aop("validate")
	public boolean add(@Param("..") Appmenu obj,Errors es){
		return appmenuService.add(obj);
	}
	
	@At
	public boolean delete(@Param("..") Appmenu obj){
		return appmenuService.delete(obj);
	}
	
	@At
	public boolean update(@Param("..") Appmenu obj){
		return appmenuService.update(obj);
	}
}